/**
 * Copyright (c) 2017-2017 All Rights Reserved.
 */
package com.zbest.zpay.gw.parser.wx;

import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.zbest.common.lang.util.XmlHelper;
import com.zbest.zpay.gw.model.MessageContext;
import com.zbest.zpay.gw.parser.MessageParser;

/**
 * 
 *
 * @author Administrator
 * @version $Id: UnifiedorderParser.java, v 0.1 2017-5-2 下午11:39:01 Administrator Exp $
 */
public class UnifiedorderParser implements MessageParser {

    /** 
     * @see com.zbest.zpay.gw.parser.MessageParser#parse(com.zbest.zpay.gw.model.MessageContext)
     */
    @Override
    public void parse(MessageContext messageContext) {
        //1.验证签名
        //2.解析报文
        Map<String, String> responseMap = XmlHelper.parseXml((String) messageContext
            .getReceiveMessage());

        if (StringUtils.equals(responseMap.get("return_code"), "SUCCESS")) {
            if (StringUtils.equals(responseMap.get("result_code"), "SUCCESS")) {
               // response.setSuccess(true);
            } else {
               // response.setSuccess(false);
              //  response.setRespCode(responseMap.get("err_code"));
              //  response.setRespMsg(responseMap.get("err_code_des"));
            }
        } else {
          //  response.setSuccess(false);
           // response.setRespCode(responseMap.get("return_code"));
           // response.setRespMsg(responseMap.get("return_msg"));
        }
     //   return response;

    }

}
